Graph classification dimensions

  • Directionality determines if edges are one-way or two-way. In an undirected graph, edges represent a symmetric relationship (A is connected to B, and B to A). In a directed graph (or digraph), edges have a direction, representing an asymmetric relationship (A points to B).
  • Weights can be added to edges to represent costs, distances, capacities, or any numeric relationship. An unweighted graph treats all edges as equivalent, while a weighted graph attaches meaningful numeric values to edges that affect algorithms like shortest path calculations.
  • A simple graph has no self-loops and at most one edge between any pair of vertices, making it the cleanest and most common model. This restriction simplifies many algorithms and proofs by eliminating edge multiplicity concerns.
  • A multigraph allows multiple edges between the same pair of vertices, which is useful for modeling scenarios like multiple flight routes between cities or parallel communication channels. Some multigraphs also permit self-loops where a vertex connects to itself.
  • Choose the minimal model that accurately represents your data to avoid unnecessary complexity in both implementation and analysis. Starting with simpler assumptions like unweighted or simple graphs makes code cleaner and more maintainable unless your application specifically requires the additional features.